package ar.edu.uba.fi.jmit.monitorengine.mock;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import ar.edu.uba.fi.jmit.integrationcommons.Event;
import ar.edu.uba.fi.jmit.monitorengine.core.Monitor;

public class MockMonitor2 extends Monitor {

	protected static Logger logger = Logger.getLogger(MockMonitor2.class);
	
	private static List<Event> executedEvents;
	
	public MockMonitor2() {
		super();
	}

	@Override
	public void doExecute(Event event) {
		logger.debug("Executing event: " + event);
		executedEvents.add(event);
	}

	@Override
	public void init(Map<String, String> configuration) {
		logger.debug("init Mock Monitor 2");
	}
	
	public static List<Event> getExecutedEvents() {
		return executedEvents;
	}

	public static void restart() {
		logger.info("restarting Mock Monitor 2");
		executedEvents = new LinkedList<Event>();
	}

}
